package com.zzxy.spring.service.impl;

import com.zzxy.spring.dao.IStudentDao;
import com.zzxy.spring.dao.impl.StudentDaoImpl;
import com.zzxy.spring.service.IStudentService;


public class StudentServiceImpl implements IStudentService {
    private IStudentDao studentDao;

//    public IStudentDao getStudentDao() {
//        return studentDao;
//    }
//
//    public void setStudentDao(IStudentDao studentDao) {
//        this.studentDao = studentDao;
//    }
    @Override
    public void addStudent(String username, String password) {
        studentDao.addStudent(username, password);
    }

    @Override
    public void updateStudent(int id) {
        try {
//            int i = 1 / 0;
            System.out.println("update student ...");
        }catch (Exception e){
            System.out.println(e.getMessage());
            throw new RuntimeException(e);
        }
    }

    @Override
    public void deleteStudent(int id) {
        System.out.println("delete student ...");
    }

    public void setStudentDao(StudentDaoImpl studentDao) {
        this.studentDao = studentDao;
    }
}
